import request from '@/utils/request'

export default {
  // 获取课程信息
  selectCourses() {
    return request({
      url: `/eduCourse/selectCourses`,
      method: 'get'
    })
  },
  // 获取课程列表信息
  selectCoursesByCourseVo(course) {
    return request({
      url: `/eduCourse/selectCoursesByCourseVo`,
      method: 'post',
      data: course
    })
  },
  // 获取一级和二级课程分类信息，为树形结构
  selectSubject() {
    return request({
      url: `/eduSubject/selectSubject`,
      method: 'post'
    })
  },
  // 获取课程详情信息
  selectCourseDetail(courseId) {
    return request({
      url: `/eduCourse/selectCourseDetail/${courseId}`,
      method: 'get'
    })
  },
  // 获取评论信息
  selectAllComments(commentQuery) {
    return request({
      url: `/eduComment/selectAllComments`,
      method: 'post',
      data: commentQuery
    })
  },
  // 添加一条评论
  addComment(comment) {
    return request({
      url: `/eduComment/addComment`,
      method: 'post',
      data: comment
    })
  }
}
